//
//  VIPBaseVideoManager.m
//  TTProduct
//
//  Created by Taurin on 2019/12/25.
//  Copyright © 2019 TTProduct. All rights reserved.
//

#import "VIPBaseVideoManager.h"
#import "VIPBaseVideoManager.h"
#import "VIPAgoraVideoManager.h"
#import "VIPZegoVideoManager.h"
#import "VIPRoomModel.h"
#import "VIPMacros.h"

@interface VIPBaseVideoManager()

@property (strong, nonatomic) VIPRoomModel *roomModel;
// 创建成功后回调
@property (copy, nonatomic) LiveRealTimeHandler remoteViewHandler;

@end

@implementation VIPBaseVideoManager

#pragma mark - Public
- (void)bindingRoomInfo:(VIPRoomModel *)room {
    self.roomModel = room;
};

- (void)joinLiveVideo:(NSView *)localView {
    _localView = localView;
    
    // 初始化视频通道
    [self setupLiveServerEngine];
    
    // 进入频道
    [self joinChannel];
}

#pragma mark - Private
- (void)setupLiveServerEngine { }
- (void)joinChannel { }

- (void)remoteDidJoined:(NSUInteger)uid completionHandler:(nullable void (^)(NSView *remoteView))completionHandler {
    // 管上一层要View
    if (!self.realTimeRemoteView) { return; }
    _remoteViewHandler = completionHandler;
    self.realTimeRemoteView(uid);
}

+ (instancetype)shareManager { return nil; }

@end
